﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;


namespace JoinExtention
{
    public static class ExtentionICollection
    {
        public static string Join<T>(this ICollection<T> collection)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append('[');
            foreach (var item in collection)
            {
                sb.Append(item.ToString()+", ");
            }
            if (sb.Length > 4)
            {
                sb.Remove(sb.Length - 2, 2);
            }
            sb.Append("]");
            string result = sb.ToString();
            return result;
        }
    }
}
